package day240313.e2;

import java.util.Scanner;

public class Fibonacci {
    public static int fibonacci(int number) {
        if (number <= 2) return 1;
        else return fibonacci(number - 1) + fibonacci(number - 2);
    }

    public static void main(String[] args) {
        int number;
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入你要查询第几个斐波那契数：");
        number = scanner.nextInt();
        System.out.println("第" + number + "位斐波那契数是：" + fibonacci(number));
    }
}
